<%@include file="template/configuration.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>
            ${website} || 
            <c:choose>
                <c:when test="${not empty pagetoedit}">Edit</c:when>
                <c:otherwise>Add</c:otherwise>
            </c:choose>page
        </title>
        ${stylesheet}
        ${jquery}
        ${jswysiwyg}
    </head>
    <body>
        <div class="container">
            <%@include file="template/header.jsp" %>
            <div class="content">
                <h1>Manage pages</h1>
                <h3>
                    <c:choose>
                        <c:when test="${not empty pagetoedit}">Edit</c:when>
                        <c:otherwise>Add</c:otherwise>
                    </c:choose>page
                </h3>
                <form action="${url}ManagePage" method="POST">
                    <input type="hidden" value="${page.id}" name="pageid" />
                    <label for="title">Editing ${page.title}</label> <input type="hidden" name="title" value="${page.title}" id="title" required/>
                    </br>
                    <label for="content">Content</label> <textarea name="content" id="content" required>${page.content}</textarea>
                    </br>
                    <label>&nbsp;</label> <input type="submit" value="Save page"/>
                </form>
            </div>
            <%@include file="template/footer.jsp" %>
        </div>
    </body>
</html>
